<%@ include file="/common/parse.jsp"%>
<%!
	// 校验是否为实时号
	public String checkSource(String path) {
		Map<String, Object> conf = parseXML(path);
		String flag = (String)conf.get("schedule");
		return flag;
	}
	
	
	/**
	 * 检查当前时间上下午
	 * @param integers 数组  第一个小时，第二个分钟， 第三个秒
	 * @return
	 */
	public String getHalf(Integer...integers) {
		 int length = integers.length;
		 int _hour = 12, _minute = 0, _second = 0;
		 switch (length) {
			case 0:
				break;
			case 1:
				_hour = integers[0];
				break;
			case 2:
				_hour = integers[0];
				_minute = integers[1];
				break;
			case 3:
				_hour = integers[0];
				_minute = integers[1];
				_second = integers[2];
				break;
			default:
				break;
		}
		 Calendar cal = Calendar.getInstance();
		 int hour = cal.get(Calendar.HOUR_OF_DAY);
		 int minute = cal.get(Calendar.MINUTE);
		 int second = cal.get(Calendar.SECOND);
		 if (hour > _hour) {
			 return "2";
		 } else if (hour < _hour) {
			 return "1";
		 } else {
			 if (minute > _minute) {
				 return "2";
			 } else if (minute < _minute) {
				 return "1";
			 } else {
				 if (second >= _second) {
					 return "2";
				 } else {
					 return "1";
				 }
			 }
		 }
	}

%>